package start;

import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.nio.SelectChannelConnector;
import org.eclipse.jetty.webapp.WebAppContext;

public class StartSpringMVC {

	public static void main(String[] args) throws Exception {
		Server server = new Server();
		// connector
		SelectChannelConnector connector = new SelectChannelConnector();
		connector.setPort(8917);
		connector.setMaxIdleTime(1000 * 60 * 60);
		connector.setSoLingerTime(-1);
		server.setConnectors(new Connector[] { connector });
		// handler
		WebAppContext web = new WebAppContext();
		web.setParentLoaderPriority(true);
		web.setContextPath("/");
		web.setWar("webapps");
		
		server.setHandler(web);

		server.start();
		server.join();
		System.out.println("启动结束!");

	}
}
